<template>
    <div class="my-checkbox">
      <div class="row" >
        <el-checkbox-group v-model="checkList">
          <el-checkbox v-for="(item,index) in checkboxData" :key="index" :label="item" @change="change(item)">{{ item.xuanxiangneirong }}</el-checkbox>
        </el-checkbox-group>
        <!-- <el-checkbox v-model="checked" @change="change(item)">{{ item.xuanxiangneirong }}</el-checkbox> -->
      </div>
    </div>
</template>
<script>
  export default {
    name: 'my-checkbox',
    props: {
      checkboxData: {
        required: true
      },
      // 新加的
      checkboxName: {
        required: true
      }
    },
    data() {
      return {
        checked: false,
        checkList: [],
      }
    },
    created() {
    },
    methods: {
      change(data) {
        this.$emit('checkboxChange', this.checkList, this.checkboxName);
      },
    }
  }
</script>